import request from '@/utils/request'

//统一字典下拉框查询
export function adminDict(params) {
  return request({
    url: `common/v1/adminDict`,
    method: 'get',
    params
  })
}

// 查询会员列表列表
export function getList(query) {
  return request({
    url: '/merchant/equity/card/apply/list',
    method: 'get',
    params: query
  })
}
//查询用户区域下拉框
export function areaList() {
    return request({
      url: '/common/v1/user/area/select',
      method: 'get',
    })
}

// 查询神椰行业下拉框
export function industrySelect() {
    return request({
      url: '/common/v1/industry/select',
      method: 'get',
    })
}

// 查询商家申请列表统计
export function getNumber(params) {
  return request({
    url: '/merchant/equity/card/apply/number',
    method: 'get',
    params: params,
  })
}

// 保存申请信息
export function addApply(data) {
  return request({
    url: '/merchant/equity/card/apply',
    method: 'post',
    data: data
  })
}

//查询所属店铺下拉框
export function shopSelect() {
    return request({
      url: '/merchant/lucrative/equity/card/shop/select',
      method: 'get',
    })
}

//查询连锁店铺下拉框
export function chainSelect(chainId) {
    return request({
      url: `/merchant/lucrative/equity/card/chain/shop/select/${chainId}`,
      method: 'get',
    })
}

//审核商家申请
export function refusedMerchant(data) {
    return request({
      url: '/merchant/equity/card/apply/audit',
      method: 'put',
      params: data
    })
  }

// 修改会员列表
export function updateCustomer(data) {
  return request({
    url: '/userManager/customer',
    method: 'put',
    data: data
  })
}

// 删除会员列表
export function delCustomer(id) {
  return request({
    url: '/userManager/customer/' + id,
    method: 'delete'
  })
}

// 导出会员列表
export function exportCustomer(query) {
  return request({
    url: '/userManager/customer/export',
    method: 'get',
    params: query
  })
}
//查询商家申请详情
export function applyDetail(id) {
  return request({
    url: '/merchant/equity/card/apply/detail/'+id,
    method: 'get',
  })
}

// 获取会员卡使用记录

export function cardBillList(params) {
  return request({
    url: '/userManager/customer/card/bill/list/',
    method: 'get',
    params,
  })
}
// 获取权益卡列表信息
export function equityCardList(query) {
  return request({
    url: '/userManager/customer/equity/card/list',
    method: 'get',
    params: query
  })
}
// 获取权益卡详情
export function customerCardDetail(id) {
  return request({
    url: '/userManager/customer/equity/card/detail/' + id,
    method: 'get'
  })
}
// 获取数字权益卡门店权益列表
export function cardShopList(query) {
  return request({
    url: '/equityManager/equityCard/cardShopList',
    method: 'get',
    params: query
  })
}

// 获取coin详情列表
export function customerCoinList(query) {
  return request({
    url: '/userManager/customer/coin/list',
    method: 'get',
    params: query
  })
}
// 获取权益卡详情
export function referrerList(query) {
  return request({
    url: `/userManager/customer/referrerList`,
    method: 'get',
    params: query
  })
}




